package cn.edu.xmu.orderpayment.payment.model.bo;

import cn.edu.xmu.orderpayment.payment.model.vo.SimpleAdminUser;
import lombok.*;

import java.time.LocalDateTime;

/**
 * @Author Zhang Liu
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class ErrorAccount {

    public enum State
    {
    TOBEPAID(0,"待处理"),
    PAID(1,"已处理");
    private int code;
    private String state;
    State(int code, String state) {
        this.code=code;
        this.state=state;
    }
    public Byte getCode(){
        return new Byte((byte) code);
    }

    public String getState(){return state;}
}
    private Long id;
    private String tradeSn;
    private Long patternId;
    private Long income;
    private Long expenditure;
    private String documentId;
    private Byte state;
    private LocalDateTime time;
    private String descr;
    private Long adjustId;
    private SimpleAdminUser creator;
    private SimpleAdminUser modifier;
    private SimpleAdminUser adjust;
    private LocalDateTime gmtCreate;
    private LocalDateTime gmtModified;

    public void createErrorAccount(String tradeSn,Long patternId,Long income,Long expenditure,LocalDateTime time)
    {
        this.time=time;
        this.tradeSn=tradeSn;
        this.patternId=patternId;
        this.income=income;
        this.expenditure=expenditure;
        this.state=(byte)0;
    }
}
